package com.example.demo.listener;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * 监听器
 * @author zhuyaotong
 * @date 2021/05/29
 */
public class MyTaskListener implements TaskListener {

    /**
     * 指定负责人
     * @param delegateTask
     */
    @Override
    public void notify(DelegateTask delegateTask) {
        String taskName = "创建申请";
        String eventName = "create";
        if (taskName.equals(delegateTask.getName())
                && eventName.equals(delegateTask.getEventName())) {
            delegateTask.setAssignee("张三");
        }
    }

}
